package com.rslai.base.tool.servertest.config;

import com.rslai.base.tool.servertest.annotation.Property;
import com.rslai.base.tool.servertest.command.CompareDatabaseStepCommand;
import com.rslai.base.tool.servertest.command.StepCommand;
import com.rslai.base.tool.servertest.model.KeyValueStore;

import java.util.Arrays;

public class CompareDatabaseStepConfig extends StepConfig {
    public static final String NAME = "compareDatabase";
    public static final String DATABASE = "database";
    public static final String IGNORE = "ignore";
    public static final String EXPECTED = "expected";
    public static final String REPLACETABLENAME = "replaceTableName";

    @Property(defaultValue = "default")
    private String database;

    @Property
    private String ignore;

    @Property
    private String expected;

    @Property("replaceTableName")
    private String replaceTableName;

    public StepCommand createCommand() {
        return new CompareDatabaseStepCommand(Arrays.asList(new KeyValueStore[]{new KeyValueStore("database", this.database), new KeyValueStore("ignore", this.ignore), new KeyValueStore("expected", this.expected), new KeyValueStore("replaceTableName", this.replaceTableName)}));
    }
}
